//
//  GolfGame.h
//  Golf
//
//  Created by mrbradle on 11/28/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "GolfPlayer.h"

@interface GolfGame : NSObject {
    
    int* deck;
    int deckPos;
    
    int numRounds;
    int numPlayers;
    
    int round;
    int turn;
    int topCard;
    int drawnCard; //-1 if no one has drawn a card
    int knocker; //-1 if no one has knocked yet
    
    bool deckEmpty;
    
    bool roundOver;
    bool gameOver;
    
    NSMutableArray* players;
    
}

+ (int)MAX_CARDS; //why doesn't it have static variables alkdjfhalsdkfjawiueghfoai

- (id)initWithRounds:(int)rounds players:(int)players names:(NSMutableArray*)names;

- (void)shuffle;
- (int)dealCard;

- (void)startRound;
- (void)endGame;
- (void)endRound;
- (void)endTurn;
- (int)getCardValue:(int)card; //calculates the score for one card.
- (int)getHandValue:(int)player; //calculates the score for one player's hand.

- (void)swap:(int)target; //swaps either the drawn card or the top card FOR THE CURRENT PLAYER
- (void)draw; //draws the top card
- (void)discard; //discards the card that was drawn
- (void)knock; //knocks FOR THE CURRENT PLAYER

@property (nonatomic) IBOutlet int* deck;
@property (nonatomic) IBOutlet int deckPos;

@property (nonatomic) IBOutlet int numRounds;
@property (nonatomic) IBOutlet int numPlayers;

@property (nonatomic) bool deckEmpty;

@property (nonatomic) IBOutlet int round;
@property (nonatomic) IBOutlet int turn;
@property (nonatomic) IBOutlet int topCard;
@property (nonatomic) IBOutlet int drawnCard;
@property (nonatomic) IBOutlet int knocker;

@property (nonatomic) IBOutlet bool roundOver;
@property (nonatomic) IBOutlet bool gameOver;

@property (nonatomic,retain) IBOutlet NSMutableArray* players;

@end
